const {ccclass, property} = cc._decorator;

@ccclass
export default class NewClass extends cc.Component {

    @property
    speed: number = 800;

    onLoad () {

    }

    start () {

    }

    update (dt: number) {
        this.node.y += dt*this.speed;
        const x = this.node.x;
        const y = this.node.y + this.speed * dt;
        this.node.setPosition(x, y);
        if (y > this.node.parent.getContentSize().height) {
            this.node.destroy();
        }
    }

}
